package lab02.test03;

public class Student {

    String name;
    int age;
    float english;
    float computer;
    float math;

    public Student() {}

    public Student (String name,int age, float english,float computer,float math) {//学生年龄和姓名
        this.name=name ;
        this.age=age ;
        this.english=english;
        this.computer=computer;
        this.math=math;
    }

    public void setEnglish(float english) {
        english = english;
    }

    public float getEnglish() {
        return english;
    }

    public void setMath(float math) {
        this.math = math;
    }

    public float getMath() {
        return math;
    }

    public float sum(){
        return english + computer + math ;
    }
    public float avg(){
        return this.sum() / 3 ;
    }
    public float max(){
        float max = computer>math?computer:math ;
        max = max>english?max:english ;
        return max ;
    }
    public float min(){
        float min = computer<math?computer:math ;
        min = min<english?min:english ;
        return min ;
    }
    public void print(){
        System.out.println("学生姓名:"+name);
        System.out.println("学生年龄："+age);
        System.out.println("数学成绩：" + math);
        System.out.println("计算机成绩：" + computer);
        System.out.println("英语成绩：" + english);
        System.out.println("总分："+sum());
        System.out.println("平均分："+avg());
        System.out.println("最低分："+min());
        System.out.println("最高分："+max());

    }


}



